<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>注册</title>

    <link rel="stylesheet" href="../cssClass/regist.css">
    <link rel="shortcut icon" href="images/camera.ico">
</head>

<body>
    <!--头部-->
    <div id="reg_header">
        <div class="reg_h_center">
            <div class="reg_h_left">
                <img src="images/logo.png" alt="">
                <h3>欢迎注册</h3>
            </div>
        </div>
    </div>


    <!--表单内容-->
    <div class="reg_back">
        <div class="reg_left">
            <p>新用户注册</p>
            <p>USER REGISTER</p>
        </div>
        <div class="reg_center">
            <div class="reg_form">
                <form action="#" method="post" id="MyMessage_div">
                    <table>
                        <tr>
                            <td class="td_left"><label for="username">用户名</label></td>
                            <td class="td_right"><input type="text" name="username" placeholder="请输入用户名" id="username">
                            </td>
                        </tr>
                        <tr>
                            <td class="td_left"><label for="password">密码</label></td>
                            <td class="td_right"><input type="password" name="password" placeholder="请输入密码"
                                    id="password"></td>
                        </tr>
                        <tr>
                            <td class="td_left"><label for="Email">Email</label></td>
                            <td class="td_right"><input type="email" name="email" placeholder="请输入Email" id="Email">
                            </td>
                        </tr>
                        <tr>
                            <td class="td_left"><label for="rename">姓名</label></td>
                            <td class="td_right"><input type="text" name="rename" placeholder="请输入真实姓名" id="rename">
                            </td>
                        </tr>
                        <tr>
                            <td class="td_left"><label for="Telphone">手机号</label></td>
                            <td class="td_right"><input type="text" name="telphone" placeholder="请输入您的手机号"
                                    id="Telphone"></td>
                        </tr>
                        <tr>
                            <td class="td_left"><label>性别</label></td>
                            <td class="td_right"><input type="radio" name="gender" value="male" checked> 男
                                <input type="radio" name="gender" value="female"> 女
                            </td>
                        </tr>
                        <tr>
                            <td class="td_left"><label for="Birthday">出生日期</label></td>
                            <td class="td_right"><input type="date" name="birthday" id="Birthday"></td>
                        </tr>
                        <tr>
                            <td class="td_left"><label for="checkcode">验证码</label></td>
                            <td class="td_right"><input type="text" name="checkcode" id="checkcode">
                                <img src="images/商城素材/check_code.png" id="img_check">
                            </td>
                            <!-- 10.png为验证码图片 -->
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: center;"><input type="submit" value="注册" id="btn_sub">
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="reg_right">
            <p>已有账号?<a href="login.html">立即登录</a></p>
        </div>
    </div>
</body>

</html>
<script>
    // JavaScript代码
    const form = document.querySelector(".reg_form");
    if (form === null) {
        console.error("表单元素未找到！请检查元素ID是否正确。");
    }
    form.addEventListener("submit", function (event) {
        event.preventDefault(); // 阻止表单提交
        alert('注册成功！')

    });

</script>